<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">封面图:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-cover_img" data-rule="required" class="form-control" size="50" readonly name="row[cover_img]" type="text" value="">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="plupload-cover_img" class="btn btn-danger plupload" data-url="goods/upload" data-input-id="c-cover_img" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-cover_img"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-cover_img"></span>
            </div>
            <ul class="row list-inline plupload-preview" id="p-cover_img"></ul>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">轮播图:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-goodsimg" data-rule="required" class="form-control" size="50" readonly name="row[goodsImages]" type="text" value="">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="plupload-goodsimg" class="btn btn-danger plupload" data-maxcount="5" data-url="goods/upload" data-input-id="c-goodsimg" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="true" data-preview-id="p-goodsimg"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-goodsimg"></span>
            </div>
            <ul class="row list-inline plupload-preview" id="p-goodsimg"></ul>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Goods_name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-goods_name" data-rule="required" class="form-control" name="row[goods_name]" type="text">
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Goods_sort')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-goods_sort" data-rule="required" class="form-control" name="row[goods_sort]" type="number" value="0">
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">状态:</label>
        {:build_radios('row[goods_status]', $statusMap)}
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">项目简介:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-goods_detail" class="form-control editor" rows="5" name="row[goods_detail]" cols="50"></textarea>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">注意事项:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-goods_info" class="form-control editor" rows="5" name="row[note]" cols="50"></textarea>
        </div>
    </div>

    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
<script src="https://xm.xmlhzx.cn/assets/js/jquery-2.1.1.min.js"></script>
<script>
    $(document).ready(function(){
        // +号图片点击事件
        $(document.body).on("click", "#uploadimg", function () {
            $("#plupload-goodsimg").trigger('click');
        });
    });
</script>
